[Android] How do I load URL that requires login into variable?
Posted
by bebeTech
on Stack Overflow
See other posts from Stack Overflow
or by bebeTech
Published on 2010-05-01T13:43:36Z
Indexed on
2010/05/01
13:47 UTC
Read the original article
Hit count: 234
I am trying to port my usage meter from a JavaScript Gadget (win) / Widget (OSX) to Android. Total newbie when comes to JAVA + Eclipse + Android 2.1 SDK. Essentially what I want to do is load a page, pass through a username and password and load the resulting page into a array that I can then run some regular expressions through.
My code from JavaScript (I've replace the actual URL with a dummy one) is:
xmlhttp.open("post","https://acme.com.au/your_account/index.php?function=login",false);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("check_username=" + username + "&password=" + password);
I need to know the Android equivalent to the above please. I've played around with WebView but that loads the page in a web browser which isn't what I want.
© Stack Overflow or respective owner